function [st, acq, block] = block_info2(varargin)

global CONTROL

st=[];
acq=[];
block = 0;
sout = []; % string output
if(nargin == 1)
    sf = varargin{1};
    filename = slash4OS([CONTROL(sf).path '/' CONTROL(sf).filename]);
    RL = cell2mat(seq_parse(CONTROL(sf).reclist));
else
    filename = varargin{1};
    RL = varargin{2};
end;

    
try
    index = load(filename, 'Index');
catch
   if(isempty(RL))
       fprintf(1, '%s has empty Index\n', filename);
   else
       QueMessage(sprintf('block_info2: Index is empty in %s', filename), 1);
   end;
    warning on
    return;
end;
warning on;

if(isempty(index) | ~isstruct(index) | isempty(fieldnames(index)))
   if(isempty(RL))
       fprintf(1, '%s has empty Index\n', filename);
   else
       QueMessage(sprintf('block_info2: Index is empty in %s', filename), 1);
   end;
   return;
end;
while(isempty(strmatch('date', fieldnames(index), 'exact')))
   index = eval(['index.' char(fieldnames(index))]);
end;

if(~isempty(RL))
   frec = min(RL);
   blk = find([index(:).record] == frec);
%   dfile.record = min([index.record]); %should be 1 for first record
%   dfile.nr_channel = 2; % use the default; it can change anytime
else
   return;
end

%if (max(RL) > dfile.records_in_file)
%   QueMessage(sprintf('Last record (%i) greater than length of file (%i recs in file)',max(RL),dfile.records_in_file), 1);
%   return
%end

data_blks = strmatch('DATA', char(index.type), 'exact');
if(isempty(data_blks))
   QueMessage('block_info2: No data blocks in index? ', 1);
   return;
end;

% make a fake end block....
maxind = length(index)+1;
index(maxind).record=10000000;
data_blks = [data_blks; maxind];

% dfile.frec=RL(1);
% dfile.lrec=RL(end);
% dfile.record = [];
% dfile.rate = [];
% dfile.gain = [];
% dfile.rate = [];
% dfile.nr_points = [];
% dfile.block = data_blks; % save the data blocks too (only in this version)
dfile.dblock = [];
rec_ptr = 1;
for indxi = 1:length(data_blks) % look for the data in all the blocks (it doesn't hurt to search)
   ind = data_blks(indxi);
   %   fprintf(2, '%d: %d -- %d\n', indxi, index(ind-1).record, index(ind).record-1);
  % fprintf(1, '[index(ind-1).record=%d; index(ind).record=%d]\n', index(ind-1).record, index(ind).record);
   if(any(RL >= index(ind-1).record) & any(RL <= index(ind).record - 1)) % any records in this block?      
      this_block = index(ind).block;
      %      fprintf(2, 'this_blk: %d\n', this_block);
      [st, acq] = block_info(filename, this_block);
      block  = this_block;
   end;
end;


return;



